package com.blockchain.gulimall.ssoclient.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;
import java.util.List;

/**
 * @author guoch0613@163.com
 * @Description
 * @create 2021-05-08 17:47
 */
@Controller
public class HelloController {

    @ResponseBody
    @GetMapping("/hello")
    public String hello(){
        return "hello";
    }

    @GetMapping("/employees")
    public String employees(Model model){
        List<String> emps = new ArrayList<>();
        emps.add("张三");
        emps.add("王五");
        emps.add("李四");
        model.addAttribute("emps",emps);
        return "list";
    }

}
